package com.enjoy.concurrent.ch8;

public class TaskResult<R> {

    private final TaskResultType resultType;

    private final R result;

    private final String reason;

    public TaskResult(TaskResultType resultType, R result, String reason) {
        this.resultType = resultType;
        this.result = result;
        this.reason = reason;
    }

    public TaskResult(TaskResultType resultType, R result) {
        this.resultType = resultType;
        this.result = result;
        this.reason = null;
    }

    public TaskResultType getResultType() {
        return resultType;
    }

    public R getResult() {
        return result;
    }

    public String getReason() {
        return reason;
    }
}
